/**
 * Created by felix on 2017/2/25.
 */
import React from 'react';
import styles from './index.less';

function Extra({ data, cols, component, isOpen }) {
    const colSpan = cols.length;
    return (
        <tr
            className={styles.extra}
        >
            <td
                colSpan={colSpan}
            >
                <div
                    className={styles.wrap}
                    style={{
                        display: isOpen ? 'block' : 'none',
                    }}
                >
                    {component(data)}
                </div>
            </td>
        </tr>
    );
}

export default Extra;
